/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package uk.co.drpj.midi.piano;

import java.awt.Dimension;
import java.awt.Point;
import java.util.Observable;
import javax.sound.midi.Receiver;
import javax.sound.midi.Synthesizer;
import javax.swing.JComponent;
import javax.swing.JScrollPane;

/**
 *
 * @author pjl
 */
public class Piano  {

  
    JScrollPane pianoPanel;
   

    public Piano( Receiver recv) {
   
   
        Dimension vdim12 = new Dimension(2000, 60);
        VirtualKeyboard12 vkeyboard12 = new VirtualKeyboard12();
        vkeyboard12.setSize(vdim12);
        vkeyboard12.setPreferredSize(vdim12);
        vkeyboard12.setMinimumSize(vdim12);
        vkeyboard12.setMaximumSize(vdim12);
        vkeyboard12.setChannel(0);
        vkeyboard12.setReceiver(recv);

        pianoPanel = new JScrollPane(vkeyboard12);
        pianoPanel.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);
        pianoPanel.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
        pianoPanel.setPreferredSize(new Dimension(2000, 100));
        pianoPanel.setMinimumSize(new Dimension(500, 100));
        pianoPanel.setMaximumSize(new Dimension(5000, 100));
        pianoPanel.getViewport().setViewPosition(new Point(450, 0));
    }

    public JComponent getPanel() {
        return pianoPanel;
    }
}
